<?php
/**
 * @author Nguyễn Sơn Tùng <sontung.x305@gmail.com> <YM :terminator_nst>
 * @version 1.0
 * @copyright fteam.vn
 * Date: 24/04/2012
 * Time: 16:44
 */
?>
<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'login-form',
    'enableClientValidation'=>true,
    'clientOptions'=>array(
        'validateOnSubmit'=>true,
        'errorCssClass'=>'error-form',
        'successCssClass'=>'success-form'
    ),
    'enableAjaxValidation'=>true,
    'htmlOptions'=>array(
        'class'=>'form with-margin',
        'name'=>'login-form'
    ),
)); ?>
<div class="form-row row-fluid">
    <div class="span12">
        <div class="row-fluid relative">
            <?php echo $form->labelEx($model,'username',array('class'=>'form-label span12','title'=>t('Enter username or your email','flogin'))); ?>
            <span class="icon16 ficonlog icomoon-icon-user-2 right gray marginR10"></span>
            <?php // echo $form->textField($model,'username',array('class'=>'span12','value'=>'Administrator','title'=>t('Enter username or your email','flogin'),'onfocus'=>'if(this.value=="Administrator")this.value=""','onblur'=>'if(this.value=="") this.value="Administrator"','autoComplete'=>'off')); ?>
            <?php echo $form->textField($model,'username',array('class'=>'span12','title'=>t('Enter username or your email','flogin'),'autoComplete'=>'off','tabindex'=>'1')); ?>
        </div>
        <?php echo $form->error($model, 'username'); ?>
    </div>
</div>

<div class="form-row row-fluid">
    <div class="span12">
        <div class="row-fluid relative">
                <?php echo $form->labelEx($model,'password',array('class'=>'form-label span12','for'=>'password','title'=>t('Enter your password','flogin'))); ?>
                <span class="icon16 ficonlog icomoon-icon-locked right gray marginR10"></span>
                <span class="forgot absolute"><?php echo CHtml::link(t('Forgot your password?','flogin'),'#'); ?></span>
            <?php // echo $form->passwordField($model,'password',array('class'=>'span12','value'=>'Password','title'=>t('Enter your password','flogin'),'onfocus'=>'if(this.value=="Password")this.value=""','onblur'=>'if(this.value=="") this.value="Password"')); ?>
            <?php echo $form->passwordField($model,'password',array('class'=>'span12','title'=>t('Enter your password','flogin'),'tabindex'=>'2')); ?>
        </div>
        <?php echo $form->error($model, 'password'); ?>
    </div>
</div>
<div class="form-row row-fluid">
    <div class="span12">
        <div class="row-fluid">
            <div class="form-actions">
                <div class="span12 controls">
                    <?php echo $form->checkBox($model,'rememberMe',array('class'=>'styled')) ?>
                    <?php echo $form->labelEx($model,'rememberMe',array('class'=>'inline')); ?>
                    <button tabindex="3" type="submit" class="btn btn-info right" id="loginBtn"><span class="icon16 icomoon-icon-enter white"></span> <?php echo t('Login','flogin'); ?></button>
                </div>
            </div>
        </div>
    </div>
</div>

<?php $this->endWidget(); ?>
<?php
 $js = '$(document).ready(function() {
        $("input, textarea, select").not(\'.nostyle\').uniform();
    });';
Yii::app()->clientScript->registerScript('loginScript',$js,2);
?>
